<div class="row">
	<div class="panel callout">
		<h6>Edit Subject</h6>
	</div>
	<?if(isset($system_message))echo $system_message;?>
	<?php 
		$formAttrib = array('id' => 'addsubject', 'class' => 'admin-form');
		$roomLevelAttrib = array('' => 'Select level assignment..');
		$subjectNameAttrib = array('name' => 'code', 'value' => set_value('code',$subject->subj_code), 'id' => 'name');
		$subjectStatusAttrib = array('active' => 'Active', 'inactive' => 'Inactive');
		$time = !empty($subject->time)? explode('-',$subject->time) : array('0'=>'0:00','1'=>'0:00');
		
		echo form_open('admin/edit_subject/'.$subject->subj_id, $formAttrib);
		foreach($levels as $level){
			$roomLevelAttrib[$level->level_id] = strtoupper($level->level_code).' - '.$level->level_desc;
		}
	?>
    
    <div class="input-block">
      <?php
		  echo form_label('Grade Level :', 'grade_level_id');
		  echo form_dropdown('grade_level_id', $roomLevelAttrib, $subject->grade_level_id);	
	  ?>
    </div>
	
	<div class="input-block">
		<label>Academic Year:</label>
		<?php echo form_dropdown('academic_year', $academic_year, $subject->for_academic_year);	?>
    </div>
    
    <div class="input-block">
    <?php
		echo form_hidden('subj_id', $subject->subj_id);
		echo form_label('Subject Code :', 'name');
		echo form_input($subjectNameAttrib);		
	?>
    </div>

	<div class="input-block">
		<label>Unique Alphanumeric ID</label>
		<input type="text" name="subj_uniq_id" value="<?=set_value('subj_uniq_id',$subject->subj_uniq_id);?>" required placeholder="Enter Alphanumeric Unique ID for Subject">
    </div>
    
	<div class="input-block">
		<label>Subject Description</label>
		<input type="text" name="description" value="<?=set_value('description',$subject->subj_desc);?>">
    </div>

    
    <div class="input-block">
    <?php
		echo form_label('Subject Status :', 'subj_stat');
		echo form_dropdown('subj_stat', $subjectStatusAttrib, $subject->subj_stat);	
	?>
    </div>
	
	<div class="input-block">
		<label>Subject Unit:</label>
		<input type="number" max="10" min="0" required name="subject_unit" step="any" value="<?=set_value('subject_unit',$subject->subj_units);?>">
	</div>
   
    <div class="input-block" style="clear:both;">
		<?php echo form_submit('save', 'Save Changes','class="btn btn-small btn-primary"'); ?>
    	<a href="<?=site_url('admin/subjects');?>" class="btn">Back to Subjects</a>
	</div>
	</form>
</div>
